package comparators;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;

public class ComparatorTest {
	public static void main(String[] args) {
		
		
		// set with no duplicates (name)
		
		Set<TestObject> set = new HashSet<TestObject>();
		
		set.add(new TestObject("abc", 0));
		set.add(new TestObject("abc", 0));
		set.add(new TestObject("abc", 0));

		System.out.println(set);
		
		
		
		// sorted list
		List<TestObject> list = new ArrayList<TestObject>();
		list.add(new TestObject("a", 1));
		list.add(new TestObject("b", 3));
		list.add(new TestObject("c", 2));
		
		Collections.sort(list);
		System.out.println(list);
		
		
		int[] arr = {1, 2, 4, 5, 99, 1, 3, 5};
		Arrays.sort(arr);
		for(int a : arr){
			System.out.println(a);
		}
	}
}
